package yunwo.cn.yzstation.presenter;

import yunwo.cn.yzstation.api.IcompletedModel;
import yunwo.cn.yzstation.api.IcompletedView;
import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.InventoryBean;
import yunwo.cn.yzstation.model.CompletedModel;
import yunwo.cn.yzstation.view.activity.InventoryActivity;
import yunwo.cn.yzstation.view.fregment.inventory.CompleteddFragment;

/**
 * Created by lao on 2017/9/19.
 */
public class CompletedFragmentPersenter extends BasePresenter<IcompletedView> implements IcompletedModel {
    InventoryActivity activity;
    CompleteddFragment completedFragment;
    IcompletedView icompletedView;
    private final CompletedModel mCompletedModel;

    public CompletedFragmentPersenter(InventoryActivity activity, CompleteddFragment completedFragment, IcompletedView icompletedView) {
        this.activity = activity;
        this.completedFragment = completedFragment;
        this.icompletedView = icompletedView;
        mCompletedModel = new CompletedModel(activity, this);
    }

    public void getData(String type, int pagenum, int pagesize) {
        mCompletedModel.getData(type,pagenum,pagesize);
    }

    @Override
    public void getListDataSuccess(InventoryBean.DataBean dataBean, String type) {
        icompletedView.getListDataSuccess(dataBean,type);
    }

    @Override
    public void getListDataFailure() {
        icompletedView.getListDataFailure();
    }
}
